/*******************************************************************************
 * Copyright 2011 @ Kapil Viren Ahuja
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.kapilvirenahuja.eamsteps.info;

import java.util.List;

public class Row
{
    private final HeaderInfo[] headerInfo;
    private Cell[]             cells;
    private int                columnCount;
    private final String       identifier;


    public HeaderInfo[] getHeaderInfo()
    {
        return headerInfo; // NOPMD because this is internal class and we guarantee the implementation.
    }


    public Cell[] getCells()
    {
        return cells; // NOPMD because this is internal class and we guarantee the implementation.
    }


    public void setCells(Cell[] cells) // NOPMD because this is internal class and we guarantee the implementation.
    {
        this.cells = cells;
    }


    public int getColumnCount()
    {
        return columnCount;
    }


    public void setColumnCount(int columnCount)
    {
        this.columnCount = columnCount;
    }


    public String getId()
    {
        return identifier;
    }


    public Row(String id, HeaderInfo[] headerInfo, List<Cell> cells) // NOPMD because this is internal class and we
    {
        this.cells = cells.toArray(new Cell[cells.size()]);
        this.columnCount = this.cells.length;

        this.identifier = id;
        this.headerInfo = headerInfo;
    }


    @Override
    public String toString()
    {
        return this.identifier;
    }
}
